package models

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(30);not null"`
	Password string `gorm:"type:varchar(32);not null"`
}
type UserRole struct {
	gorm.Model
	Uid int `gorm:"type:int;not null"`
	Rid int `gorm:"type:int;not null"`
}
type Role struct {
	gorm.Model
	RoleName string `gorm:"type:varchar(50);not null"`
}
type RoleNode struct {
	gorm.Model
	Rid int `gorm:"type:int;not null"`
	Nid int `gorm:"type:int;not null"`
}
type Node struct {
	gorm.Model
	NodeName string `gorm:"type:varchar(50);not null"`
}
type Car struct {
	gorm.Model
	CarCode   string `gorm:"type:varchar(50);not null"` //车牌号
	CarName   string `gorm:"type:varchar(50);not null"` //车辆
	CarPeople string `gorm:"type:varchar(50);not null"` //司机
}
type Order struct {
	gorm.Model
	OrderCode    string `gorm:"type:varchar(50);not null"` //订单编号
	BeginAddress string `gorm:"type:varchar(50);not null"` //开始地址
	ToAddress    string `gorm:"type:varchar(50);not null"` //到达地址
	OrderName    string `gorm:"type:varchar(50);not null"` //货物名称
	Cid          int    `gorm:"type:int;not null"`         //车辆ID
}
type OrderList struct {
	OrderID      int
	CarCode      string
	CarName      string
	CarPeople    string
	OrderCode    string
	BeginAddress string
	ToAddress    string
	OrderName    string
}

//////////货物仓库管理系统//////////

type Repo struct {
	gorm.Model
	RepoCode string `gorm:"type:varchar(50);not null"` //仓库编号
	RepoName string `gorm:"type:varchar(50);not null"` //仓库名称
}
type RepoOrder struct {
	gorm.Model
	OrderCode string `gorm:"type:varchar(50);not null"` //订单编号
	OrderFrom string `gorm:"type:varchar(50);not null"` //供应商
	GoodNum   int    `gorm:"type:int;not null"`         //商品数量
	Price     int    `gorm:"type:int;not null"`         //金额
	Rid       int    `gorm:"type:int;not null"`         //仓库id
}
type RepoOrderList struct {
	RepoOrderId int
	RepoCode    string
	RepoName    string
	OrderCode   string
	OrderFrom   string
	GoodNum     int
	Price       int
}
